home *** CD-ROM | disk | FTP | other *** search
/ .net 2002 March / DotNetMagazine-Issue107-Coverdisc-NET107-02-03-PCMac.bin / pc / PC Software / picks / HTTrack / httrack-3.22-3.exe / {app} / src_win / WinHTTrack / inprogress.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2002-10-30  |  30.1 KB  |  1,082 lines

  1. // inprogress.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Shell.h"
  6. #include "inprogress.h"
  7. #include "about.h"
  8. #include "iplog.h"
  9.  
  10. #include "NewProj.h"
  11. //#include "option.h"
  12.  
  13. /* Externe C */
  14. extern "C" {
  15.   #include "htsbase.h"
  16.   #include "htscore.h"
  17. }
  18.  
  19. #include "Wid1.h"
  20. #include "EasyDropTarget.h"
  21.  
  22. #include "InfoUrl.h"
  23.  
  24. extern CNewProj* dialog0;
  25. extern CMainTab* maintab;
  26.  
  27. /*
  28. extern int INPROGRESS_LOCKED;
  29. */
  30. extern int termine_requested;
  31. extern int termine;
  32. extern int soft_term_requested;
  33. /*
  34. extern int INPROGRESS_LOCKED;
  35. extern int INREFRESH_LOCKED;
  36. */
  37. extern HICON httrack_icon;
  38. //extern int fexist(char*);
  39. //extern char* fconcat(char*,char*);
  40. extern char choixdeb[3];
  41. // PATCH-->
  42. extern int termine;
  43.  
  44. // Helper
  45. extern LaunchHelp* HtsHelper;
  46.  
  47. // InfoUrl
  48. extern CInfoUrl* _Cinprogress_inst;
  49.  
  50. #ifdef _DEBUG
  51. #define new DEBUG_NEW
  52. #undef THIS_FILE
  53. static char THIS_FILE[] = __FILE__;
  54. #endif
  55.  
  56. // Refresh
  57. //extern int INFILLMEM_LOCKED;     // refresh mÈmoire en cours
  58. extern InpInfo SInfo;
  59. int inprogress_refresh();
  60.  
  61. // this app
  62. #include "Winhttrack.h"
  63. extern CWinHTTrackApp* this_app;
  64.  
  65.  
  66. // objet
  67. extern Cinprogress* inprogress;
  68.  
  69.  
  70. /* pour la fin */
  71. #include "DialogContainer.h"
  72. #include "splitter.h"
  73. extern CSplitterFrame* this_CSplitterFrame;
  74. #include "infoend.h"
  75. extern Cinfoend* this_Cinfoend;
  76.  
  77. /* Main WizTab frame */
  78. #include "WizTab.h"
  79. extern CWizTab* this_CWizTab;
  80. extern CWizTab* this_intCWizTab;
  81.  
  82. // Pour la fin
  83. char end_mirror_msg[8192]="";
  84.  
  85. extern t_StatsBuffer StatsBuffer[NStatsBuffer];
  86.  
  87.  
  88. /////////////////////////////////////////////////////////////////////////////
  89. // Cinprogress dialog
  90. IMPLEMENT_DYNCREATE(Cinprogress, CPropertyPage)
  91.  
  92.  
  93. Cinprogress::Cinprogress()
  94.     : CPropertyPage(Cinprogress::IDD)
  95. {
  96.   timer=0;
  97.   //{{AFX_DATA_INIT(Cinprogress)
  98.     m_inphide = FALSE;
  99.     //}}AFX_DATA_INIT
  100. }
  101.  
  102. void Cinprogress::DoDataExchange(CDataExchange* pDX)
  103. {
  104.     CPropertyPage::DoDataExchange(pDX);
  105.     //{{AFX_DATA_MAP(Cinprogress)
  106.     DDX_Control(pDX, IDC_nn9, m_nn9);
  107.     DDX_Control(pDX, IDC_nn8, m_nn8);
  108.     DDX_Control(pDX, IDC_nn7, m_nn7);
  109.     DDX_Control(pDX, IDC_nn6, m_nn6);
  110.     DDX_Control(pDX, IDC_nn5, m_nn5);
  111.     DDX_Control(pDX, IDC_nn4, m_nn4);
  112.     DDX_Control(pDX, IDC_nn3, m_nn3);
  113.     DDX_Control(pDX, IDC_nn2, m_nn2);
  114.     DDX_Control(pDX, IDC_nn13, m_nn13);
  115.     DDX_Control(pDX, IDC_nn12, m_nn12);
  116.     DDX_Control(pDX, IDC_nn11, m_nn11);
  117.     DDX_Control(pDX, IDC_nn10, m_nn10);
  118.     DDX_Control(pDX, IDC_nn1, m_nn1);
  119.     DDX_Control(pDX, IDC_nn0, m_nn0);
  120.     DDX_Control(pDX, IDC_nm13, m_nm13);
  121.     DDX_Control(pDX, IDC_nm12, m_nm12);
  122.     DDX_Control(pDX, IDC_nm11, m_nm11);
  123.     DDX_Control(pDX, IDC_nm10, m_nm10);
  124.     DDX_Control(pDX, IDC_nm9, m_nm9);
  125.     DDX_Control(pDX, IDC_nm8, m_nm8);
  126.     DDX_Control(pDX, IDC_nm7, m_nm7);
  127.     DDX_Control(pDX, IDC_nm6, m_nm6);
  128.     DDX_Control(pDX, IDC_nm5, m_nm5);
  129.     DDX_Control(pDX, IDC_nm4, m_nm4);
  130.     DDX_Control(pDX, IDC_nm3, m_nm3);
  131.     DDX_Control(pDX, IDC_nm2, m_nm2);
  132.     DDX_Control(pDX, IDC_nm1, m_nm1);
  133.     DDX_Control(pDX, IDC_nm0, m_nm0);
  134.     DDX_Control(pDX, IDC_st13, m_st13);
  135.     DDX_Control(pDX, IDC_st12, m_st12);
  136.     DDX_Control(pDX, IDC_st11, m_st11);
  137.     DDX_Control(pDX, IDC_st10, m_st10);
  138.     DDX_Control(pDX, IDC_st9, m_st9);
  139.     DDX_Control(pDX, IDC_st8, m_st8);
  140.     DDX_Control(pDX, IDC_st7, m_st7);
  141.     DDX_Control(pDX, IDC_st6, m_st6);
  142.     DDX_Control(pDX, IDC_st5, m_st5);
  143.     DDX_Control(pDX, IDC_st4, m_st4);
  144.     DDX_Control(pDX, IDC_st3, m_st3);
  145.     DDX_Control(pDX, IDC_st2, m_st2);
  146.     DDX_Control(pDX, IDC_st1, m_st1);
  147.     DDX_Control(pDX, IDC_st0, m_st0);
  148.     DDX_Control(pDX, IDC_sk0, m_sk0);
  149.     DDX_Control(pDX, IDC_sk1, m_sk1);
  150.     DDX_Control(pDX, IDC_sk2, m_sk2);
  151.     DDX_Control(pDX, IDC_sk3, m_sk3);
  152.     DDX_Control(pDX, IDC_sk4, m_sk4);
  153.     DDX_Control(pDX, IDC_sk5, m_sk5);
  154.     DDX_Control(pDX, IDC_sk6, m_sk6);
  155.     DDX_Control(pDX, IDC_sk7, m_sk7);
  156.     DDX_Control(pDX, IDC_sk8, m_sk8);
  157.     DDX_Control(pDX, IDC_sk9, m_sk9);
  158.     DDX_Control(pDX, IDC_sk10, m_sk10);
  159.     DDX_Control(pDX, IDC_sk11, m_sk11);
  160.     DDX_Control(pDX, IDC_sk12, m_sk12);
  161.     DDX_Control(pDX, IDC_sk13, m_sk13);
  162.     DDX_Control(pDX, IDC_sl0, m_sl0);
  163.     DDX_Control(pDX, IDC_sl1, m_sl1);
  164.     DDX_Control(pDX, IDC_sl2, m_sl2);
  165.     DDX_Control(pDX, IDC_sl3, m_sl3);
  166.     DDX_Control(pDX, IDC_sl4, m_sl4);
  167.     DDX_Control(pDX, IDC_sl5, m_sl5);
  168.     DDX_Control(pDX, IDC_sl6, m_sl6);
  169.     DDX_Control(pDX, IDC_sl7, m_sl7);
  170.     DDX_Control(pDX, IDC_sl8, m_sl8);
  171.     DDX_Control(pDX, IDC_sl9, m_sl9);
  172.     DDX_Control(pDX, IDC_sl10, m_sl10);
  173.     DDX_Control(pDX, IDC_sl11, m_sl11);
  174.     DDX_Control(pDX, IDC_sl12, m_sl12);
  175.     DDX_Control(pDX, IDC_sl13, m_sl13);
  176.     DDX_Check(pDX, IDC_inphide, m_inphide);
  177.     //}}AFX_DATA_MAP
  178. }
  179.  
  180. //const UINT wm_IcnRest = RegisterWindowMessage( FINDMSGSTRING );
  181. #define wm_CEasyDropTargetCallback (WM_USER + 2)
  182. #define wm_Timer (WM_USER + 3)
  183. #define wm_MirrorFinished (WM_USER + 4)
  184. BEGIN_MESSAGE_MAP(Cinprogress, CPropertyPage)
  185.     //{{AFX_MSG_MAP(Cinprogress)
  186.     ON_WM_CLOSE()
  187.     ON_BN_CLICKED(IDC_sk0, Onsk0)
  188.     ON_BN_CLICKED(IDC_sk1, Onsk1)
  189.     ON_BN_CLICKED(IDC_sk2, Onsk2)
  190.     ON_BN_CLICKED(IDC_sk3, Onsk3)
  191.     ON_BN_CLICKED(IDC_sk4, Onsk4)
  192.     ON_BN_CLICKED(IDC_sk5, Onsk5)
  193.     ON_BN_CLICKED(IDC_sk6, Onsk6)
  194.     ON_BN_CLICKED(IDC_sk7, Onsk7)
  195.     ON_BN_CLICKED(IDC_sk8, Onsk8)
  196.     ON_BN_CLICKED(IDC_sk9, Onsk9)
  197.     ON_BN_CLICKED(IDCANCEL, OnEscape)
  198.     ON_BN_CLICKED(IDC_ipabout, Onipabout)
  199.     ON_WM_DESTROY()
  200.     ON_WM_HELPINFO()
  201.     ON_BN_CLICKED(IDC_sk10, Onsk10)
  202.     ON_BN_CLICKED(IDC_sk11, Onsk11)
  203.     ON_BN_CLICKED(IDC_sk12, Onsk12)
  204.     ON_BN_CLICKED(IDC_sk13, Onsk13)
  205.     ON_WM_CREATE()
  206.     ON_BN_CLICKED(IDC_nm0, Onnm0)
  207.     ON_BN_CLICKED(IDC_nm1, Onnm1)
  208.     ON_BN_CLICKED(IDC_nm2, Onnm2)
  209.     ON_BN_CLICKED(IDC_nm3, Onnm3)
  210.     ON_BN_CLICKED(IDC_nm4, Onnm4)
  211.     ON_BN_CLICKED(IDC_nm5, Onnm5)
  212.     ON_BN_CLICKED(IDC_nm6, Onnm6)
  213.     ON_BN_CLICKED(IDC_nm7, Onnm7)
  214.     ON_BN_CLICKED(IDC_nm8, Onnm8)
  215.     ON_BN_CLICKED(IDC_nm9, Onnm9)
  216.     ON_BN_CLICKED(IDC_nm10, Onnm10)
  217.     ON_BN_CLICKED(IDC_nm11, Onnm11)
  218.     ON_BN_CLICKED(IDC_nm12, Onnm12)
  219.     ON_BN_CLICKED(IDC_nm13, Onnm13)
  220.     ON_BN_CLICKED(IDC_nn0, Onnm0)
  221.     ON_BN_CLICKED(IDC_nn1, Onnm1)
  222.     ON_BN_CLICKED(IDC_nn2, Onnm2)
  223.     ON_BN_CLICKED(IDC_nn3, Onnm3)
  224.     ON_BN_CLICKED(IDC_nn4, Onnm4)
  225.     ON_BN_CLICKED(IDC_nn5, Onnm5)
  226.     ON_BN_CLICKED(IDC_nn6, Onnm6)
  227.     ON_BN_CLICKED(IDC_nn7, Onnm7)
  228.     ON_BN_CLICKED(IDC_nn8, Onnm8)
  229.     ON_BN_CLICKED(IDC_nn9, Onnm9)
  230.     ON_BN_CLICKED(IDC_nn10, Onnm10)
  231.     ON_BN_CLICKED(IDC_nn11, Onnm11)
  232.     ON_BN_CLICKED(IDC_nn12, Onnm12)
  233.     ON_BN_CLICKED(IDC_nn13, Onnm13)
  234.   ON_BN_CLICKED(IDC_st0, Onst0)
  235.     ON_BN_CLICKED(IDC_st1, Onst1)
  236.     ON_BN_CLICKED(IDC_st2, Onst2)
  237.     ON_BN_CLICKED(IDC_st3, Onst3)
  238.     ON_BN_CLICKED(IDC_st4, Onst4)
  239.     ON_BN_CLICKED(IDC_st5, Onst5)
  240.     ON_BN_CLICKED(IDC_st6, Onst6)
  241.     ON_BN_CLICKED(IDC_st7, Onst7)
  242.     ON_BN_CLICKED(IDC_st8, Onst8)
  243.     ON_BN_CLICKED(IDC_st9, Onst9)
  244.     ON_BN_CLICKED(IDC_st10, Onst10)
  245.     ON_BN_CLICKED(IDC_st11, Onst11)
  246.     ON_BN_CLICKED(IDC_st12, Onst12)
  247.     ON_BN_CLICKED(IDC_st13, Onst13)
  248.     ON_WM_TIMER()
  249.     ON_BN_CLICKED(IDC_inphide, Oninphide)
  250.     //}}AFX_MSG_MAP
  251.   ON_MESSAGE( wm_CEasyDropTargetCallback, DragDropText)
  252.   ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnToolTipNotify )
  253.   ON_BN_CLICKED(ID_ABOUT,Onipabout)
  254.   ON_BN_CLICKED(ID_FILE_EXIT,OnStopall)
  255.   ON_BN_CLICKED(ID_LOG_VIEWLOG,OniplogLog)
  256.   ON_BN_CLICKED(ID_LOG_VIEWERRORLOG,OniplogErr)
  257.   ON_BN_CLICKED(ID_LOG_VIEWTRANSFERS,OnViewTransfers)
  258.   ON_BN_CLICKED(ID_FILE_PAUSE,OnPause)
  259.   ON_BN_CLICKED(ID_OPTIONS_MODIFY,OnModifyOpt)
  260.   ON_COMMAND(ID_HELP_FINDER,OnHelpInfo2)
  261.   ON_COMMAND(ID_HELP,OnHelpInfo2)
  262.     ON_COMMAND(ID_DEFAULT_HELP,OnHelpInfo2)
  263.   // Fin du miroir
  264.   ON_MESSAGE( wm_MirrorFinished, OnEndMirror)
  265.   END_MESSAGE_MAP()
  266. //ON_REGISTERED_MESSAGE( wm_IcnRest, IconRestore )
  267. /////////////////////////////////////////////////////////////////////////////
  268. // Cinprogress message handlers
  269.  
  270. void Cinprogress::OnClose() 
  271. {
  272.   OnStopall();
  273. }
  274.  
  275. void Cinprogress::Onsk0()  {
  276.   if (hts_is_parsing(-1)) {  // parsing
  277.     if (hts_is_testing())
  278.       hts_cancel_test();     // cancel test
  279.     /*else*/
  280.     hts_cancel_parsing();  // cancel parsing
  281.   } else
  282.     StatsBuffer_cancel(0);
  283. }
  284. void Cinprogress::Onsk1()  {
  285.   StatsBuffer_cancel(1);
  286. }
  287. void Cinprogress::Onsk2()  {
  288.   StatsBuffer_cancel(2);
  289. }
  290. void Cinprogress::Onsk3()  {
  291.   StatsBuffer_cancel(3);
  292. }
  293. void Cinprogress::Onsk4()  {
  294.   StatsBuffer_cancel(4);
  295. }
  296. void Cinprogress::Onsk5()  {
  297.   StatsBuffer_cancel(5);
  298. }
  299. void Cinprogress::Onsk6()  {
  300.   StatsBuffer_cancel(6);
  301. }
  302. void Cinprogress::Onsk7()  {
  303.   StatsBuffer_cancel(7);
  304. }
  305. void Cinprogress::Onsk8()  {
  306.   StatsBuffer_cancel(8);
  307. }
  308. void Cinprogress::Onsk9()  {
  309.   StatsBuffer_cancel(9);
  310. }
  311. void Cinprogress::Onsk10()  {
  312.   StatsBuffer_cancel(10);
  313. }
  314. void Cinprogress::Onsk11()  {
  315.   StatsBuffer_cancel(11);
  316. }
  317. void Cinprogress::Onsk12()  {
  318.   StatsBuffer_cancel(12);
  319. }
  320. void Cinprogress::Onsk13()  {
  321.   StatsBuffer_cancel(13);
  322. }
  323.  
  324.  
  325. // Capture des static
  326. void Cinprogress::Onnm0()  { StatsBuffer_info(0); }
  327. void Cinprogress::Onnm1()  { StatsBuffer_info(1); }
  328. void Cinprogress::Onnm2()  { StatsBuffer_info(2); }
  329. void Cinprogress::Onnm3()  { StatsBuffer_info(3); }
  330. void Cinprogress::Onnm4()  { StatsBuffer_info(4); }
  331. void Cinprogress::Onnm5()  { StatsBuffer_info(5); }
  332. void Cinprogress::Onnm6()  { StatsBuffer_info(6); }
  333. void Cinprogress::Onnm7()  { StatsBuffer_info(7); }
  334. void Cinprogress::Onnm8()  { StatsBuffer_info(8); }
  335. void Cinprogress::Onnm9()  { StatsBuffer_info(9); }
  336. void Cinprogress::Onnm10() { StatsBuffer_info(10); }
  337. void Cinprogress::Onnm11() { StatsBuffer_info(11); }
  338. void Cinprogress::Onnm12() { StatsBuffer_info(12); }
  339. void Cinprogress::Onnm13() { StatsBuffer_info(13); }
  340.  
  341. void Cinprogress::Onst0()  { StatsBuffer_info(0); }
  342. void Cinprogress::Onst1()  { StatsBuffer_info(1); }
  343. void Cinprogress::Onst2()  { StatsBuffer_info(2); }
  344. void Cinprogress::Onst3()  { StatsBuffer_info(3); }
  345. void Cinprogress::Onst4()  { StatsBuffer_info(4); }
  346. void Cinprogress::Onst5()  { StatsBuffer_info(5); }
  347. void Cinprogress::Onst6()  { StatsBuffer_info(6); }
  348. void Cinprogress::Onst7()  { StatsBuffer_info(7); }
  349. void Cinprogress::Onst8()  { StatsBuffer_info(8); }
  350. void Cinprogress::Onst9()  { StatsBuffer_info(9); }
  351. void Cinprogress::Onst10() { StatsBuffer_info(10); }
  352. void Cinprogress::Onst11() { StatsBuffer_info(11); }
  353. void Cinprogress::Onst12() { StatsBuffer_info(12); }
  354. void Cinprogress::Onst13() { StatsBuffer_info(13); }
  355.  
  356. // touche escape
  357. void Cinprogress::OnEscape() { 
  358.   OnStopall();
  359. }
  360.  
  361. void Cinprogress::OnStopall() 
  362. {
  363.   this_CSplitterFrame->CheckRestore();
  364.   if (AfxMessageBox(
  365.     LANG(LANG_H1 /*"Stop WinHTTrack?",
  366.            "Stopper WinHTTrack?"*/)
  367.     ,MB_OKCANCEL+MB_ICONQUESTION)==IDOK) {
  368.     hts_setpause(0);
  369.     if (soft_term_requested)
  370.       termine_requested=1;
  371.     else {
  372.       soft_term_requested=1;
  373.       hts_request_stop(0);
  374.     }
  375.   }
  376. }
  377.  
  378. void Cinprogress::Onipabout() 
  379. {
  380.   Cabout about;
  381.   about.DoModal();
  382. }
  383.  
  384. void Cinprogress::OnDestroy() 
  385. {
  386.   //((CWnd*)this)->m_pCtrlCont->OnUIActivate(NULL);
  387.   WHTT_LOCK();
  388.   termine_requested=1;    // quit!
  389.   WHTT_UNLOCK();
  390.   StopTimer();
  391.   if (BackAffLog)
  392.   if (form.m_hWnd)
  393.     form.EndDialog(IDOK);       // terminer!
  394.   this_CSplitterFrame->CheckRestore();
  395.   //Sleep(150);             // Èvite les problËmes d'accËs ‡ m_hWnd juste avant le destroy
  396.   CPropertyPage::OnDestroy();
  397. }
  398.  
  399. BOOL Cinprogress::OnInitDialog() 
  400. {
  401.   m_inphide=TRUE;
  402.   UpdateData(false);      // force to call DoDataExchange
  403.   inprogress=this;
  404.  
  405.   memset(&SInfo, 0, sizeof(SInfo));
  406.  
  407.   BackAffLog=NULL;
  408.   strcpybuff(pathlog,"");
  409.  
  410.     //CPropertyPage::OnInitDialog();
  411.   EnableToolTips(true);     // TOOL TIPS
  412.  
  413.   // initialisation des champs pour les redraws en boucle
  414.   element[0][0]=&m_st0;
  415.   element[0][1]=&m_st1;
  416.   element[0][2]=&m_st2;
  417.   element[0][3]=&m_st3;
  418.   element[0][4]=&m_st4;
  419.   element[0][5]=&m_st5;
  420.   element[0][6]=&m_st6;
  421.   element[0][7]=&m_st7;
  422.   element[0][8]=&m_st8;
  423.   element[0][9]=&m_st9;
  424.   element[0][10]=&m_st10;
  425.   element[0][11]=&m_st11;
  426.   element[0][12]=&m_st12;
  427.   element[0][13]=&m_st13;
  428.  
  429.   element[1][0]=&m_nm0;
  430.   element[1][1]=&m_nm1;
  431.   element[1][2]=&m_nm2;
  432.   element[1][3]=&m_nm3;
  433.   element[1][4]=&m_nm4;
  434.   element[1][5]=&m_nm5;
  435.   element[1][6]=&m_nm6;
  436.   element[1][7]=&m_nm7;
  437.   element[1][8]=&m_nm8;
  438.   element[1][9]=&m_nm9;
  439.   element[1][10]=&m_nm10;
  440.   element[1][11]=&m_nm11;
  441.   element[1][12]=&m_nm12;
  442.   element[1][13]=&m_nm13;
  443.  
  444.   // rajoutÈ
  445.   element[4][0]=&m_nn0;
  446.   element[4][1]=&m_nn1;
  447.   element[4][2]=&m_nn2;
  448.   element[4][3]=&m_nn3;
  449.   element[4][4]=&m_nn4;
  450.   element[4][5]=&m_nn5;
  451.   element[4][6]=&m_nn6;
  452.   element[4][7]=&m_nn7;
  453.   element[4][8]=&m_nn8;
  454.   element[4][9]=&m_nn9;
  455.   element[4][10]=&m_nn10;
  456.   element[4][11]=&m_nn11;
  457.   element[4][12]=&m_nn12;
  458.   element[4][13]=&m_nn13;
  459.  
  460.   element[2][0]=&m_sl0;
  461.   element[2][1]=&m_sl1;
  462.   element[2][2]=&m_sl2;
  463.   element[2][3]=&m_sl3;
  464.   element[2][4]=&m_sl4;
  465.   element[2][5]=&m_sl5;
  466.   element[2][6]=&m_sl6;
  467.   element[2][7]=&m_sl7;
  468.   element[2][8]=&m_sl8;
  469.   element[2][9]=&m_sl9;
  470.   element[2][10]=&m_sl10;
  471.   element[2][11]=&m_sl11;
  472.   element[2][12]=&m_sl12;
  473.   element[2][13]=&m_sl13;
  474.  
  475.   element[3][0]=&m_sk0;
  476.   element[3][1]=&m_sk1;
  477.   element[3][2]=&m_sk2;
  478.   element[3][3]=&m_sk3;
  479.   element[3][4]=&m_sk4;
  480.   element[3][5]=&m_sk5;
  481.   element[3][6]=&m_sk6;
  482.   element[3][7]=&m_sk7;
  483.   element[3][8]=&m_sk8;
  484.   element[3][9]=&m_sk9;
  485.   element[3][10]=&m_sk10;
  486.   element[3][11]=&m_sk11;
  487.   element[3][12]=&m_sk12;
  488.   element[3][13]=&m_sk13;
  489.  
  490.   /* Init checkbox */
  491.   CMenu* m;
  492.   if (m = AfxGetApp()->GetMainWnd()->GetMenu()) {
  493.     m->CheckMenuItem(ID_FILE_PAUSE,MF_UNCHECKED);
  494.   }
  495.  
  496.   // Patcher l'interface pour les FranÁais ;-)
  497.   if (LANG_T(-1)) {    // Patcher en franÁais
  498.     //SetDlgItemText(,"");
  499.     SetDlgItemText(IDC_STATIC_bytes,LANG(LANG_H8) /*"Octets sauvÈs:"*/);
  500.     SetDlgItemText(IDC_STATIC_scanned,LANG(LANG_H9) /*"Liens parcourus:"*/);
  501.     SetDlgItemText(IDC_STATIC_time,LANG(LANG_H10) /*"Temps:"*/);
  502.     SetDlgItemText(IDC_STATIC_sockets,LANG(LANG_H11) /*"Connexions:"*/);
  503.     SetDlgItemText(IDC_inphide,LANG(LANG_H12) /*"En cours:"*/);
  504.     SetDlgItemText(IDC_STATIC_informations,LANG_H16);   
  505.     SetDlgItemText(IDC_STATIC_written,LANG_H17);   
  506.     SetDlgItemText(IDC_STATIC_updated,LANG_H18);   
  507.     SetDlgItemText(IDC_STATIC_errors,LANG_H19);    
  508.     SetDlgItemText(IDC_STATIC_inprog,LANG_H20);    
  509.     //SetDlgItemText(IDC_hide,LANG(LANG_H13) /*"Cacher"*/);
  510.     SetDlgItemText(IDC_STATIC_trate,LANG(LANG_H14) /*"Taux transfert"*/);
  511.     for(int i=0;i<NStatsBuffer;i++)
  512.       element[3][i]->SetWindowText(LANG(LANG_H15));
  513.  
  514.     // patch menu
  515.     /*
  516.     CMenu* menu = GetMenu();
  517.     if (menu) {
  518.       menu->ModifyMenu(0,MF_BYPOSITION,0,LANG(LANG_O1));
  519.       menu->ModifyMenu(1,MF_BYPOSITION,1,LANG(LANG_O2));
  520.       menu->ModifyMenu(2,MF_BYPOSITION,2,LANG(LANG_O3));
  521.       menu->ModifyMenu(3,MF_BYPOSITION,3,LANG(LANG_O4));
  522.       menu->ModifyMenu(4,MF_BYPOSITION,4,LANG(LANG_O5));
  523.       //
  524.       menu->ModifyMenu(ID_FILE_PAUSE,MF_BYCOMMAND,ID_FILE_PAUSE,LANG(LANG_O10));
  525.       menu->ModifyMenu(ID_FILE_EXIT,MF_BYCOMMAND,ID_FILE_EXIT,LANG(LANG_O11));
  526.       menu->ModifyMenu(ID_OPTIONS_MODIFY,MF_BYCOMMAND,ID_OPTIONS_MODIFY,LANG(LANG_O12));
  527.       menu->ModifyMenu(ID_LOG_VIEWLOG,MF_BYCOMMAND,ID_LOG_VIEWLOG,LANG(LANG_O13));
  528.       menu->ModifyMenu(ID_LOG_VIEWERRORLOG,MF_BYCOMMAND,ID_LOG_VIEWERRORLOG,LANG(LANG_O14));
  529.       menu->ModifyMenu(ID_LOG_VIEWTRANSFERS,MF_BYCOMMAND,ID_LOG_VIEWTRANSFERS,LANG(LANG_O14b));
  530.       menu->ModifyMenu(ID_WINDOW_HIDE,MF_BYCOMMAND,ID_WINDOW_HIDE,LANG(LANG_O15));
  531.       menu->ModifyMenu(ID_ABOUT,MF_BYCOMMAND,ID_ABOUT,LANG(LANG_O16));
  532.       DrawMenuBar();
  533.     }
  534.     */
  535.   }
  536.  
  537.   /*
  538.   {
  539.     LOGFONT lf;
  540.     if (element[0][0]->GetFont()->GetLogFont(&lf)) {
  541.       CFont* fnt = new CFont();
  542.       if (fnt->CreateFont(lf.lfHeight,0,0,0,FW_DONTCARE,0,0,0,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH,"Fixedsys")) {
  543.         int i;
  544.         for (i=0;i<NStatsBuffer; i++) {
  545.           element[0][i]->SetFont(fnt,true);
  546.           element[1][i]->SetFont(fnt,true);
  547.         }
  548.       }
  549.     }
  550.   }
  551.   */
  552.  
  553.   SetIcon(httrack_icon,false);
  554.   SetIcon(httrack_icon,true);  
  555.  
  556.   if (choixdeb[0]=='!')
  557.     Oniplog(0);           // ouvrir log
  558.  
  559.   // Lancer timer!
  560.   StartTimer();
  561.  
  562.     return TRUE;  // return TRUE unless you set the focus to a control
  563.                   // EXCEPTION: OCX Property Pages should return FALSE
  564. }
  565.  
  566. void Cinprogress::StartTimer() {
  567.   if (!timer) {
  568.     timer=SetTimer(WM_TIMER,HTS_SLEEP_WIN,NULL);
  569.   }
  570. }
  571. void Cinprogress::StopTimer() {
  572.   if (timer) {
  573.     KillTimer(timer);
  574.     timer=0;
  575.   }
  576. }
  577.  
  578. UINT AffLog( LPVOID pP ) {
  579.   Cinprogress* inp = (Cinprogress*) pP;
  580.   if (inp != NULL) {
  581.     inp->form.m_iplog=(CString) "No log report";
  582.     inp->form.DoModal();
  583.     inp->BackAffLog = NULL;
  584.   }
  585.   return 0;    // thread completed successfully
  586. }
  587.  
  588. // log pour fichiers d'erreur et de log
  589. void Cinprogress::OniplogLog() {
  590.   Oniplog(0);
  591. }
  592. void Cinprogress::OniplogErr() {
  593.   Oniplog(1);
  594. }
  595.  
  596. void Cinprogress::Oniplog(int mode)  {
  597.   if (!BackAffLog) {  // pas encore lancÈ
  598.     strcpybuff(pathlog,dialog0->GetPath());
  599.     if (strlen(pathlog)>0)
  600.     if ((pathlog[strlen(pathlog)-1]!='/') && (pathlog[strlen(pathlog)-1]!='\\'))
  601.       strcatbuff(pathlog,"/");
  602.     // fichier log existe ou on est tÈlÈcommandÈ par un !
  603.     if ( (fexist(fconcat(pathlog,"hts-err.txt"))) || (fexist(fconcat(pathlog,"hts-log.txt"))) || (choixdeb[0]=='!') ) {
  604.       if (mode)
  605.         form.type_log=0;
  606.       else
  607.         form.type_log=1;
  608.       strcpybuff(form.pathlog,pathlog);
  609.       BackAffLog = AfxBeginThread(AffLog,this);
  610.     } else {
  611.       char s[1024];
  612.       sprintf(s,LANG(LANG_H2 /*"No log files in %s!","Aucun fichier d'audit dans %s!"*/),pathlog);
  613.       AfxMessageBox(s,MB_OK+MB_ICONEXCLAMATION);
  614.     }
  615.   }
  616. }
  617.  
  618. void Cinprogress::OnViewTransfers() 
  619. {
  620.   StatsBuffer_info(0);
  621. }
  622.  
  623. void Cinprogress::OnPause() 
  624. {
  625.   int m;
  626.   if (!hts_setpause(-1))
  627.     m=AfxMessageBox(LANG(LANG_H3 /*"Pause Transfer?","Placer le transfert sur pause?"*/),MB_OKCANCEL+MB_ICONQUESTION);
  628.   else
  629.     m=IDOK;
  630.   if (m==IDOK) {
  631.     hts_setpause(!hts_setpause(-1));
  632.     CMenu* m;
  633.     if (m = AfxGetApp()->GetMainWnd()->GetMenu()) {
  634.       if (hts_setpause(-1))
  635.         m->CheckMenuItem(ID_FILE_PAUSE,MF_CHECKED);
  636.       else
  637.         m->CheckMenuItem(ID_FILE_PAUSE,MF_UNCHECKED);
  638.     }
  639.   }
  640. }
  641.  
  642. // modif options
  643. void Cinprogress::OnModifyOpt() 
  644. {
  645.   static httrackp opt;
  646.   //
  647.   maintab->m_option1.modify=
  648.     maintab->m_option2.modify=
  649.     maintab->m_option3.modify=
  650.     maintab->m_option7.modify=
  651.     maintab->m_option8.modify=
  652.     maintab->m_option9.modify=
  653.     maintab->m_option11.modify=
  654.     maintab->m_option10.modify=1;    // mode modification
  655.   if (maintab->DoModal() == IDOK) {
  656.     int n;
  657.     LLint ln;
  658.  
  659.     // dÈvalider champs (non modifiÈs)
  660.     opt.maxsite = -1;
  661.     opt.maxfile_nonhtml = -1;
  662.     opt.maxfile_html = -1;
  663.     opt.maxsoc = -1;
  664.     opt.nearlink = -1;
  665.     opt.timeout = -1;
  666.     opt.rateout = -1;
  667.     opt.maxtime = -1;
  668.     opt.maxrate = -1;
  669.     strcpybuff(opt.user_agent , "");
  670.     opt.retry = -1;
  671.     opt.hostcontrol = -1;
  672.     opt.errpage = -1;
  673.     opt.travel = -1;
  674.     opt.external = -1;
  675.     opt.delete_old=-1;
  676.     opt.parseall=-1;
  677.     opt.delete_old=-1;
  678.  
  679.     opt.travel=0;         // NOTE: NE SERA PRIS EN COMPTE QUE LE BIT 8
  680.     if(maintab->m_option1.m_testall)
  681.       opt.travel|=256;     
  682.  
  683.     if(maintab->m_option1.m_parseall)
  684.       opt.parseall=1;     
  685.     else
  686.       opt.parseall=0;     
  687.  
  688.     // near link,err page
  689.     if (maintab->m_option1.m_link)
  690.       opt.nearlink=1;
  691.     else
  692.       opt.nearlink=0;
  693.  
  694.     if (maintab->m_option2.m_errpage)
  695.       opt.errpage=1;
  696.     else
  697.       opt.errpage=0;
  698.  
  699.     if (maintab->m_option2.m_external)
  700.       opt.external=1;
  701.     else
  702.       opt.external=0;
  703.  
  704.     if (maintab->m_option2.m_nopurge)
  705.       opt.delete_old=1;
  706.     else
  707.       opt.delete_old=0;
  708.  
  709.  
  710.     // host control
  711.     {
  712.       int a=0;
  713.       if (maintab->m_option4.m_remt)
  714.         a+=1;
  715.       if (maintab->m_option4.m_rems)
  716.         a+=2;
  717.       opt.hostcontrol=a;
  718.     }
  719.  
  720.     // sockets
  721.     if (strcmp(maintab->m_option4.m_connexion,"")!=0) {
  722.       if (sscanf(maintab->m_option4.m_connexion,"%d",&n) == 1)
  723.         opt.maxsoc = n;
  724.     } 
  725.  
  726.     // maxfile_nonhtml
  727.     if (strcmp(maintab->m_option5.m_othermax,"")!=0) {
  728.       if (sscanf(maintab->m_option5.m_othermax,LLintP,&ln) == 1)
  729.         opt.maxfile_nonhtml = ln;
  730.     } else
  731.       opt.maxfile_nonhtml = -1;
  732.  
  733.     // maxfile_html
  734.     if (strcmp(maintab->m_option5.m_maxhtml,"")!=0) {
  735.       if (sscanf(maintab->m_option5.m_maxhtml,LLintP,&ln) == 1)
  736.         opt.maxfile_html = ln;
  737.     } else
  738.       opt.maxfile_html = -1;
  739.  
  740.     // maxsite
  741.     if (strcmp(maintab->m_option5.m_sizemax,"")!=0) {
  742.       if (sscanf(maintab->m_option5.m_sizemax,LLintP,&ln) == 1)
  743.         opt.maxsite = ln;
  744.     } else
  745.       opt.maxsite = -1;
  746.  
  747.     // fragment
  748.     if (strcmp(maintab->m_option5.m_pausebytes,"")!=0) {
  749.       if (sscanf(maintab->m_option5.m_pausebytes,LLintP,&ln) == 1)
  750.         opt.fragment = ln;
  751.     } else
  752.       opt.fragment = -1;
  753.  
  754.     // timeout
  755.     if (strcmp(maintab->m_option4.m_timeout,"")!=0) {
  756.       if (sscanf(maintab->m_option4.m_timeout,"%d",&n) == 1)
  757.         opt.timeout = n;
  758.     } else
  759.       opt.timeout = -1;
  760.  
  761.     // rateout
  762.     if (strcmp(maintab->m_option4.m_rate,"")!=0) {
  763.       if (sscanf(maintab->m_option4.m_rate,"%d",&n) == 1)
  764.         opt.rateout = n;
  765.     } else
  766.       opt.rateout = -1;
  767.  
  768.     // maxtime
  769.     if (strcmp(maintab->m_option5.m_maxtime,"")!=0) {
  770.       if (sscanf(maintab->m_option5.m_maxtime,"%d",&n) == 1)
  771.         opt.maxtime = n;
  772.     } else
  773.       opt.maxtime = -1;
  774.  
  775.     // maxrate
  776.     if (strcmp(maintab->m_option5.m_maxrate,"")!=0) {
  777.       if (sscanf(maintab->m_option5.m_maxrate,"%d",&n) == 1)
  778.         opt.maxrate = n;
  779.     } else
  780.       opt.maxrate = -1;
  781.  
  782.     // max. connect
  783.     if (strcmp(maintab->m_option5.m_maxconn,"")!=0) {
  784.       if (sscanf(maintab->m_option5.m_maxconn,"%d",&n) == 1)
  785.         opt.maxconn = n;
  786.     } else
  787.       opt.maxconn = -1;
  788.  
  789.     // retry
  790.     if (strcmp(maintab->m_option4.m_retry,"")!=0) {
  791.       if (sscanf(maintab->m_option4.m_retry,"%d",&n) == 1)
  792.         opt.retry = n;
  793.     } else
  794.       opt.retry = -1;
  795.  
  796.     // user_agent
  797.     if (strcmp(maintab->m_option6.m_user,"")!=0) {
  798.       strcpybuff(opt.user_agent,maintab->m_option6.m_user);
  799.     }
  800.  
  801.     hts_setopt(&opt);
  802.   }
  803.   maintab->m_option1.modify=
  804.     maintab->m_option2.modify=
  805.     maintab->m_option3.modify=
  806.     maintab->m_option7.modify=
  807.     maintab->m_option8.modify=
  808.     maintab->m_option9.modify=
  809.     maintab->m_option11.modify=
  810.     maintab->m_option10.modify=0;
  811. }
  812.  
  813.  
  814.  
  815. // canceller un lien manuellement
  816. void Cinprogress::StatsBuffer_cancel(int id) {
  817.   hts_cancel_file(StatsBuffer[id].url_sav);
  818. }
  819. void Cinprogress::StatsBuffer_info(int id) {
  820.   WHTT_LOCK();
  821.   if ((!termine) && (!termine_requested) && (inprogress->m_hWnd)) {
  822.     if (SInfo.stat_time>0) {
  823.       if (StatsBuffer[id].etat[0]) {
  824.         CInfoUrl box;
  825.         box.id=StatsBuffer[id].back;
  826.         _Cinprogress_inst=&box;
  827.         WHTT_UNLOCK();
  828.         {
  829.           box.DoModal();
  830.           _Cinprogress_inst=NULL;
  831.         }
  832.         return;
  833.       }
  834.     }
  835.   }
  836.   WHTT_UNLOCK();
  837. }
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845. // ------------------------------------------------------------
  846. // TOOL TIPS
  847. //
  848. // ajouter dans le .cpp:
  849. // remplacer les deux Wid1:: par le nom de la classe::
  850. // dans la message map, ajouter
  851. // ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnToolTipNotify )
  852. // dans initdialog ajouter
  853. // EnableToolTips(true);     // TOOL TIPS
  854. //
  855. // ajouter dans le .h:
  856. // char* GetTip(int id);
  857. // et en generated message map
  858. // afx_msg BOOL OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult );
  859. BOOL Cinprogress::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult )
  860. {
  861.   TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
  862.   UINT nID =pNMHDR->idFrom;
  863.   if (pTTT->uFlags & TTF_IDISHWND)
  864.   {
  865.     // idFrom is actually the HWND of the tool
  866.     nID = ::GetDlgCtrlID((HWND)nID);
  867.     if(nID)
  868.     {
  869.       char* st=GetTip(nID);
  870.       if (st != "") {
  871.         pTTT->lpszText = st;
  872.         pTTT->hinst = AfxGetResourceHandle();
  873.         return(TRUE);
  874.       }
  875.     }
  876.   }
  877.   return(FALSE);
  878. }
  879. char* Cinprogress::GetTip(int ID)
  880. {
  881.   switch(ID) {
  882.     //case IDC_STOPALL: return LANG(LANG_H4); break; // "Stop the mirror","Stopper le miroir"); break;
  883.     //case IDC_hide:    return LANG(LANG_H5); break; // "Hide this window behind the system tray","Cacher la fenÍtre dans la barre systËme"); break;
  884.     case IDC_sk0:     return LANG(LANG_H6); break; // "Click to skip a link or interrupt parsing","Clic pour sauter un lien ou interrompre"); break;
  885.     case IDC_sk1: case IDC_sk2: case IDC_sk3: case IDC_sk4:
  886.     case IDC_sk5: case IDC_sk6: case IDC_sk7: case IDC_sk8: case IDC_sk9:
  887.                       return LANG(LANG_H7); break; // "Click to skip a link","Clic pour sauter un lien"); break;
  888.                       //
  889.   }
  890.   return "";
  891. }
  892. // TOOL TIPS
  893. // ------------------------------------------------------------
  894.  
  895.  
  896.  
  897. // Appel aide
  898. BOOL Cinprogress::OnHelpInfo2() {
  899.   return OnHelpInfo(NULL);
  900. }
  901.  
  902. BOOL Cinprogress::OnHelpInfo(HELPINFO* dummy) 
  903. {
  904.   //return CPropertyPage::OnHelpInfo(pHelpInfo);
  905.   HtsHelper->Help();
  906.   return true;
  907.   //AfxGetApp()->WinHelp(0,HELP_FINDER);    // Index du fichier Hlp
  908.   //return true;
  909. }
  910.  
  911.  
  912. int Cinprogress::OnCreate(LPCREATESTRUCT lpCreateStruct) 
  913. {
  914.     if (CPropertyPage::OnCreate(lpCreateStruct) == -1)
  915.         return -1;
  916.  
  917.   // Drag&Drop
  918.   drag=new CEasyDropTarget(this);
  919.   if (drag->IsRegistered()) {
  920.     drag->SetTextCallback(wm_CEasyDropTargetCallback);
  921.   }
  922.     
  923.     return 0;
  924. }
  925.  
  926.  
  927. // Message from CEasyDropTarget
  928. LRESULT Cinprogress::DragDropText(WPARAM wParam,LPARAM lParam) {
  929.   if (lParam) {
  930.     CString st=*((CString*) lParam);
  931.     CLIPFORMAT cfFormat=wParam;
  932.     st=Wid1::TextToUrl(st,cfFormat);
  933.     if (st=="")
  934.       AfxMessageBox(LANG(LANG_DIAL11),MB_SYSTEMMODAL);
  935.     else {
  936.       CString aff=LANG(LANG_DIAL12);
  937.       if (AfxMessageBox(aff+st,MB_SYSTEMMODAL|MB_YESNO|MB_ICONQUESTION)==IDYES) {
  938.         int pause=0;
  939.         char** tab=CEasyDropTarget::StringToArray(st);
  940.         hts_addurl(tab);
  941.         if (pause=hts_setpause(-1))
  942.           hts_setpause(0);      // enlever pause
  943.         {
  944.           int i=0;
  945.           while((hts_addurl(NULL)) && (i<100)) {
  946.             Sleep(100);
  947.             i++;
  948.           }
  949.           if (!(i<100)) {
  950.             hts_resetaddurl();
  951.             AfxMessageBox(LANG(LANG_DIAL13));
  952.           }
  953.           hts_setpause(pause);      // remettre pause Èventuelle
  954.         }
  955.         CEasyDropTarget::ReleaseStringToArray(tab);
  956.         tab=NULL;
  957.       }
  958.     }
  959.   }
  960.   return 0;
  961. }
  962.  
  963. // Refresh
  964. void Cinprogress::OnTimer(UINT nIDEvent) 
  965. {
  966.   WHTT_LOCK();
  967.   if (!termine) {
  968.     if (SInfo.refresh) {
  969.       hts_is_parsing(0);        // refresh demandÈ si en mode parsing
  970.       // while(INFILLMEM_LOCKED) Sleep(10);    // attendre au cas o˘
  971.       if (!termine)
  972.         inprogress_refresh();        // on refresh!
  973.     }
  974.     SInfo.ask_refresh=1;
  975.   }
  976.   WHTT_UNLOCK();
  977.   CPropertyPage::OnTimer(nIDEvent);
  978. }
  979.  
  980. BOOL Cinprogress::DestroyWindow() 
  981. {
  982.   StopTimer();
  983.   inprogress=NULL;
  984.   delete drag;
  985.     return CPropertyPage::DestroyWindow();
  986. }
  987.  
  988. // Fin
  989.  
  990. void Cinprogress::OnEndMirror() {
  991.   //this_CSplitterFrame->SetNewView(0,1,RUNTIME_CLASS(Cinfoend));
  992.  
  993.   // Copie de trans.cpp
  994.   this_CWizTab->ModifyStyle(WS_VISIBLE,0,0);
  995.   this_CWizTab->RedrawWindow();
  996.   //
  997.   //{
  998.   //  CWizTab* tmp;
  999.   //  tmp=this_CWizTab;
  1000.   this_CWizTab=this_intCWizTab;
  1001.   //  this_CWizTab2=tmp;
  1002.   //}
  1003.   //
  1004.   this_CWizTab->ModifyStyle(0,WS_VISIBLE,0);
  1005.   this_CWizTab->ModifyStyle(WS_DISABLED,0,0);
  1006.   this_CSplitterFrame->RedrawWindow();
  1007.   // Fin de Copie de trans.cpp
  1008.  
  1009.   this_CWizTab->EndInProgress();
  1010.   if (IsWindow(this_Cinfoend->m_hWnd))
  1011.     this_Cinfoend->SetDlgItemText(IDC_infoend,end_mirror_msg);
  1012.  
  1013.   if (hts_is_exiting() == 1) {     /* Interrupted mirror! */
  1014.     char pathlog[HTS_URLMAXSIZE*2];
  1015.     strcpybuff(pathlog,dialog0->GetPath());
  1016.     if (strlen(pathlog)>0) {
  1017.       if ((pathlog[strlen(pathlog)-1]!='/') && (pathlog[strlen(pathlog)-1]!='\\'))
  1018.         strcatbuff(pathlog,"/");
  1019.     }
  1020.     // Aborted updated.. restore old cache?!
  1021.     if ( (fexist(fconcat(pathlog,"hts-cache/old.dat"))) && (fexist(fconcat(pathlog,"hts-cache/old.ndx"))) ) {
  1022.       if (AfxMessageBox(LANG_F22b,MB_YESNO|MB_DEFBUTTON2) == IDYES) {
  1023.         if (remove(fconcat(pathlog,"hts-cache/new.dat"))) {
  1024.           AfxMessageBox(LANG_F24 );
  1025.         }
  1026.         if (remove(fconcat(pathlog,"hts-cache/new.ndx"))) {
  1027.           AfxMessageBox(LANG_F24 );
  1028.         }
  1029.         if (remove(fconcat(pathlog,"hts-cache/new.lst"))) {
  1030.           AfxMessageBox(LANG_F24 );
  1031.         }
  1032.         remove(fconcat(pathlog,"hts-cache/new.txt"));
  1033.         rename(fconcat(pathlog,"hts-cache/old.dat"),fconcat(pathlog,"hts-cache/new.dat"));
  1034.         rename(fconcat(pathlog,"hts-cache/old.ndx"),fconcat(pathlog,"hts-cache/new.ndx"));
  1035.         rename(fconcat(pathlog,"hts-cache/old.lst"),fconcat(pathlog,"hts-cache/new.lst"));
  1036.         rename(fconcat(pathlog,"hts-cache/old.txt"),fconcat(pathlog,"hts-cache/new.txt"));
  1037.       }
  1038.     }
  1039.   } else if (hts_is_exiting() == 2) {     /* No connection! */
  1040.     AfxMessageBox(LANG_F22c );
  1041.   }
  1042. }
  1043.  
  1044. BOOL Cinprogress::OnQueryCancel( ) {
  1045.   OnStopall();
  1046.   //this_CSplitterFrame->SetNewView(0,1,RUNTIME_CLASS(CDialogContainer));
  1047.   return FALSE;
  1048. }
  1049.  
  1050.  
  1051. void Cinprogress::Oninphide() 
  1052. {
  1053.   int status=IsDlgButtonChecked(IDC_inphide);
  1054.   if (status) {
  1055.     GetDlgItem(IDC_STATIC_actions)->ModifyStyle(WS_DISABLED,0);  // disabled
  1056.     GetDlgItem(IDC_STATIC_actions)->ModifyStyle(0,WS_VISIBLE);   // not visible
  1057.   } else {
  1058.     GetDlgItem(IDC_STATIC_actions)->ModifyStyle(0,WS_DISABLED);  // not disabled
  1059.     GetDlgItem(IDC_STATIC_actions)->ModifyStyle(WS_VISIBLE,0);   // visible
  1060.   }
  1061.   int i;
  1062.   for(i=0;i<NStatsBuffer;i++) {
  1063.     int j;
  1064.     for(j=0;j<5;j++) {
  1065.       if (status) {
  1066.         inprogress->element[j][i]->ModifyStyle(WS_DISABLED,0);  // disabled
  1067.         inprogress->element[j][i]->ModifyStyle(0,WS_VISIBLE);   // not visible
  1068.       } else {
  1069.         inprogress->element[j][i]->ModifyStyle(0,WS_DISABLED);  // not disabled
  1070.         inprogress->element[j][i]->ModifyStyle(WS_VISIBLE,0);   // visible
  1071.       }
  1072.     }
  1073.   }
  1074.   RedrawWindow();
  1075. }
  1076.  
  1077. BOOL Cinprogress::OnSetActive() 
  1078. {
  1079.   WHTT_LOCATION("inprogress");
  1080.     return CPropertyPage::OnSetActive();
  1081. }
  1082.